package br.com.fiap.atividade6.factory;

import java.awt.Point;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JPanel;

public aspect CriaImplementacaoA {
	
	private static Point lastFrameLocation = new Point(0, 0);
    
    public final void CriaComponenteInterface.showFrame() {
        JFrame frame = new JFrame(getTitulo());
        
   		frame.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {System.exit(0);}
		});
		    
		JPanel panel = new JPanel();
	
		panel.add(criaComponente());
		
		frame.getContentPane().add(panel);
		frame.pack();    
		frame.setLocation(lastFrameLocation);
		lastFrameLocation.translate(75, 75);
		frame.setVisible(true);  
    }

}
